//
//  CMCountDownTimer.h
//  BaseCamera
//
//  Created by jinbo on 2023/7/5.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef void(^CountdownAction)(NSInteger);
typedef void(^CountdownEndAction)(void);
/// 倒计时计时器
@interface CMCountDownTimer : NSObject
/// 几秒隐藏, 默认5S
@property (nonatomic, assign, readonly) NSInteger maxCount;
/// 每次计时回调
@property (nonatomic, strong) CountdownAction countdownAction;
/// 计时完成回调
@property (nonatomic, strong) CountdownEndAction countdownEndAction;

- (instancetype)initWithMaxCount:(NSInteger)maxCount;

/// 开始计时
- (void)start;

/// 重置计时
- (void)reset;

/// 取消计时
- (void)cancel;

@end

NS_ASSUME_NONNULL_END
